package com.steven.ourcontest.me.bean

import com.steven.ourcontest.team.bean.TeamInfo
import com.stx.xhb.androidx.entity.BaseBannerInfo

class TeamInfoBanner(team: TeamInfo) : BaseBannerInfo {
    var id: Long = 0
    var matchId: Long = 0
    lateinit var matchName: String
    lateinit var teamName: String
    var belongUserId: Long = 0
    var createTime: Long = 0
    var status: Int = 0
    var memberNum: Long = 0

    init {
        this.id = team.id
        this.matchId = team.matchId
        this.matchName = team.matchName
        this.teamName = team.teamName
        this.matchId = team.matchId
        this.belongUserId = team.belongUserId
        this.status = team.status
        this.memberNum = team.memberNum
    }

    override fun getXBannerUrl(): Any {
        return ""
    }

    override fun getXBannerTitle(): String {
        return ""
    }

    fun setTeam(team: TeamInfo): TeamInfoBanner {
        this.id = team.id
        this.matchId = team.matchId
        this.matchName = team.matchName
        this.teamName = team.teamName
        this.matchId = team.matchId
        this.belongUserId = team.belongUserId
        this.status = team.status
        this.memberNum = team.memberNum
        return this
    }

    override fun toString(): String {
        return "TeamInfoBanner(id=$id, matchId=$matchId, matchName='$matchName', teamName='$teamName', belongUserId=$belongUserId, createTime=$createTime, status=$status, memberNum=$memberNum)"
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as TeamInfoBanner

        if (id != other.id) return false
        if (matchId != other.matchId) return false
        if (matchName != other.matchName) return false
        if (teamName != other.teamName) return false
        if (belongUserId != other.belongUserId) return false
        if (createTime != other.createTime) return false
        if (status != other.status) return false
        if (memberNum != other.memberNum) return false

        return true
    }

    override fun hashCode(): Int {
        var result = id.hashCode()
        result = 31 * result + matchId.hashCode()
        result = 31 * result + matchName.hashCode()
        result = 31 * result + teamName.hashCode()
        result = 31 * result + belongUserId.hashCode()
        result = 31 * result + createTime.hashCode()
        result = 31 * result + status
        result = 31 * result + memberNum.hashCode()
        return result
    }


}